package com.jihox.abookpro.domain;

import java.io.Serializable;

import android.graphics.Bitmap;

public class Order implements Serializable {
	
	public final static int ORDER_STATUS_NOT_PAY = 0x01;
	public final static int ORDER_STATUS_PAID = 0x02;
	public final static int ORDER_STATUS_UPLOADING = 0x03;
	public final static int ORDER_STATUS_UPLOAD_WAITING = 0x04;
	public final static int ORDER_STATUS_UPLOAD_FAILED = 0x05;
	public final static int ORDER_STATUS_UPLOADED = 0x06;
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private DeliveryInfo deliveryInfo;
	private String createdtime;
	private float price;
	private String number;
	private String productId;
	private String orderId;
	private Bitmap Thumbnail;
	private BookProject bookProject;
	private Integer orderStatus;
	private String zipFilePath;
	private String zipFileCrc;
	private float shippingfee;
	private String orderDeliveryCycle;
	private String worksn;
	private int uploadProgress = 0;
	private boolean isNewOrder;
	private long uploadedSize = 0;
	private boolean isFileUploaded =false;
	private boolean onlyLastBlock = false;
	private String uploadedFileUrl;
	private Long zipFileSize;
	private String templateName;
	
	public String getTemplateName() {
		return templateName;
	}

	public void setTemplateName(String templateName) {
		this.templateName = templateName;
	}
	private String oldWorksn;
	
	public String getOldWorksn() {
		return oldWorksn;
	}

	public void setOldWorksn(String oldWorksn) {
		this.oldWorksn = oldWorksn;
	}

	public Long getZipFileSize() {
		return zipFileSize;
	}

	public void setZipFileSize(Long zipFileSize) {
		this.zipFileSize = zipFileSize;
	}

	public String getUploadedFileUrl() {
		return uploadedFileUrl;
	}

	public void setUploadedFileUrl(String uploadedFileUrl) {
		this.uploadedFileUrl = uploadedFileUrl;
	}

	public boolean isOnlyLastBlock() {
		return onlyLastBlock;
	}

	public void setOnlyLastBlock(boolean onlyLastBlock) {
		this.onlyLastBlock = onlyLastBlock;
	}

	public boolean isFileUploaded() {
		return isFileUploaded;
	}

	public void setFileUploaded(boolean isFileUploaded) {
		this.isFileUploaded = isFileUploaded;
	}

	public long getUploadedSize() {
		return uploadedSize;
	}

	public void setUploadedSize(long uploadedSize) {
		this.uploadedSize = uploadedSize;
	}

	public boolean isNewOrder() {
		return isNewOrder;
	}
	public void setNewOrder(boolean isNewOrder) {
		this.isNewOrder = isNewOrder;
	}
	
	public int getUploadProgress() {
		if (uploadProgress>100){
			uploadProgress =100;
		}
		return uploadProgress;
	}
	public void setUploadProgress(int uploadProgress) {
		this.uploadProgress = uploadProgress;
	}
	public float getShippingfee() {
		return shippingfee;
	}
	public void setShippingfee(float shippingfee) {
		this.shippingfee = shippingfee;
	}
	public String getOrderDeliveryCycle() {
		return orderDeliveryCycle;
	}
	public void setOrderDeliveryCycle(String orderDeliveryCycle) {
		this.orderDeliveryCycle = orderDeliveryCycle;
	}
	public String getWorksn() {
		return worksn;
	}
	public void setWorksn(String worksn) {
		this.worksn = worksn;
	}
	
	public float getPrice() {
		return price;
	}
	public void setPrice(float price) {
		this.price = price;
	}
	public DeliveryInfo getDeliveryInfo() {
		return deliveryInfo;
	}
	public void setDeliveryInfo(DeliveryInfo deliveryInfo) {
		this.deliveryInfo = deliveryInfo;
	}

	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public String getOs() {
		return "Android";
	}

	public String getCreatedtime() {
		return createdtime;
	}
	public void setCreatedtime(String createdtime) {
		this.createdtime = createdtime;
	}
	
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public Bitmap getThumbnail() {
		return Thumbnail;
	}
	public void setThumbnail(Bitmap thumbnail) {
		Thumbnail = thumbnail;
	}
	public BookProject getBookProject() {
		return bookProject;
	}
	public void setBookProject(BookProject bookProject) {
		this.bookProject = bookProject;
	}
	public Integer getOrderStatus() {
		return orderStatus;
	}
	public String getOrderStatusText() {
		if (orderStatus.equals(ORDER_STATUS_UPLOADED)){
			return OrderStatus.PRODUCTING.getStatus();
		}else if (orderStatus.equals(ORDER_STATUS_UPLOAD_FAILED)){
			return OrderStatus.NOTUPLOAD.getStatus();
		}else{
			return null;
		}
		
	}
	public void setOrderStatus(Integer orderStatus) {
		this.orderStatus = orderStatus;
	}
	public String getZipFilePath() {
		return zipFilePath;
	}
	public void setZipFilePath(String zipFilePath) {
		this.zipFilePath = zipFilePath;
	}
	public String getZipFileCrc() {
		return zipFileCrc;
	}
	public void setZipFileCrc(String zipFileCrc) {
		this.zipFileCrc = zipFileCrc;
	}
	
	
}
